import java.util.Scanner;

public class Demo15 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s1=sc.nextLine();
        String s2=s1;
        String[] data={"TMD","TMd","tmd","sb","sB","SB","Sb","sima","东西"};
        for (int i = 0; i < data.length; i++) {
            s2=s2.replace(data[i],"***");
        }
        System.out.println(s1);
        System.out.println(s2);
    }
}
